class UploadController < ApplicationController
 
  def new
  @mugshot = Mugshot.new
  
end

def create
  @mugshot = Mugshot.new(params[:mugshot])
  if @mugshot.save
    session[:url] = @mugshot.filename
    flash[:notice] = 'Mugshot was successfully created.'
    @cp = 1
     render :action => :new
  else
    @cp = 0
    render :action => :new
  end
end

def upload
   @mugshots = Mugshot.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @mugshots }
    end
end
end
